March 95 - Print Hints
PRINT HINTS
Writing QuickDraw GX Drivers With Custom I/O and
Buffering
DAVE HERSEY
One of the great features of QuickDraw GX is that it provides the printer driver
developer with default implementations of commonly used routines. For example, just
by specifying a few parameters in your driver's 'comm'
(gxDeviceCommunicationsType) resource, your printer driver can connect to a
printer either serially or through the Printer Access Protocol (PAP). You don't need
to write a single line of communications code!
Another powerful feature of QuickDraw GX is that you can ignore the default
implementations of printer driver routines and write your own routines instead. This
feature enables you to tailor your printer driver so that it can accommodate unique
situations. The ability to modify bits and pieces of the printing system is especially
useful when it comes to writing printer drivers with custom communications code or
buffering routines.
In general, to create custom communications code, youconfigure your driver's 'iobm'
(gxUniversalIOPrefsType)resource, create a "not connected" 'comm' resource, and
then override certain QuickDraw GX messages. For SCSI printers, however, you don't
need to create the "not connected" resource, because a SCSI format of the 'comm'
resource is already defined. We'll talk more about when you would want to use custom
communications code, and how to write it, later in this column.
Also covered is how to write custom buffering routines. You may want to use custom
buffering if, for example, you already have code that you want to use or you want to